<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  function Person(name, age) {
    this.name = name;
    this.age = age;
  }

  Person.prototype.id = 10;

  function Boy(name, age, sex) {
    Person.call(this, name, age);
    // 或者apply 调用
    //Person.apply(this, [name, age]);
    this.sex = sex;
  }

  // Object.setPrototypeOf(Boy.prototype,Person.prototype);
  var boy = new Boy('linqinghu', 23, '男');
  console.log(boy.name);
  console.log(boy.id);//undinfind 父类的原型对象并没有继//Object.setPrototypeOf(子类，父类)
</script>
</body>
</html>